<?php //pr($salarios)?>

<div class="salarios index">
	<h2><?php __('Salarios');?></h2>

	<?php // Cristina
    echo $this->Form->create('Salario');
    echo __d('salario', 'persona', true);
    echo '<br/>';
    echo $this->Form->input('persona_id', array('label' => false, 'div' => false));
    echo ' ';
    echo $this->Form->end(array('label' =>__d('salario', 'Buscar', true), 'div' => false, array('action' => 'index', $pers['Persona']['id'])));

    echo '<br/>';
//    //Cristina?>





	<table class="art-article" cellpadding="0" cellspacing="0">
	<tr>
		<th><?php echo $this->Paginator->sort('persona_id');?></th>
		<th><?php echo $this->Paginator->sort('fl_actualiza');?></th>
		<th><?php echo $this->Paginator->sort('mt_salario');?></th>
		<th><?php echo $this->Paginator->sort('Sueldo Total');?></th>
		<th class="actions"><?php __('Acciones');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($salarios as $salario):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';

		}
	?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $this->Html->link($salario['Persona']['nombres'].' '.$salario['Persona']['apellidos'], array('controller' => 'personas', 'action' => 'view', $salario['Persona']['id'])); ?>
		</td>
		<td><?php echo $salario['Salario']['fl_actualiza']; ?>&nbsp;</td>
		<td><?php echo $salario['Salario']['mt_salario']; ?>&nbsp;</td>
		<td>
		<?php
				echo	$salario['Salario']['mt_salario']+ $salario['Salario']['bn_vacaciones'] + $salario['Salario']['utilidades']+ $salario['Salario']['vacaciones']+ $salario['Salario']['bn_celular']+ $salario['Salario']['pr_experiencia']+ $salario['Salario']['bn_alimentacion']+ $salario['Salario']['educacion']+ $salario['Salario']['bn_estaciona'];
		?>
		</td>

		<td class="actions">
			<?php echo $this->Html->link($this->Html->image('editar.png', array('alt' => 'Editar', 'title' => 'Editar Salario' )), array('action' => 'edit', $salario['Salario']['id'])); ?>
			<?php echo $this->Html->link($this->Html->image('borrar.png', array('alt' => 'Borrar', 'title' => 'Borrar Salario')), array('action' => 'delete', $salario['Salario']['id']), null, sprintf(__('Esta seguro de borrar a %s?', true), $salario['Salario']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Página %page% de %pages%, mostrando %current% Salarios de %count% en total, comenzando en %start%, terminando en %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('anterior', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('siguiente', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
<div class="actions">
	<h3><?php __('Acciones'); ?></h3>

	<?php echo $this->Html->link($this->Html->image('excel.jpeg', array('alt' => 'Exportar a Excel', 'title' => 'Exportar a Excel' )), array('action' => 'xls')); ?>

	<ul>
		<li><?php echo $this->Html->link(__('Agregar Salario', true), array('action' => 'add')); ?></li>
		<li><?php echo $this->Html->link(__('Lista de Personas', true), array('controller' => 'personas', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Agregar Persona', true), array('controller' => 'personas', 'action' => 'add')); ?> </li>
	</ul>
</div>